package messaage;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

public class AddPostMsg extends Message {

	protected String forumID;
	protected String postID;
	protected String topicName;
	protected String body;
	protected String username;

	public AddPostMsg(String _username, String _forumID, String _postID,
			String _topicName, String _body) {
		this.username = _username;
		this.forumID = _forumID;
		this.postID = _postID;
		this.body = _body;
		this.topicName = _topicName;
		this.type = "AddPostMsg";
	}

	@Override
	public String toString() {
		XStream xstream = new XStream(new DomDriver());
		String xml = xstream.toXML(this)+"\0";
		
		return xml;
	}

	public int getForumID() {
		return Integer.parseInt(this.forumID);
	}

	public int getPostID() {
		return Integer.parseInt(postID);
	}

	public String getTopicName() {
		return topicName;
	}

	public String getUsername() {
		return this.username;
	}
	public String getBody() {
		return body;
	}

}
